{layout name="layout" /}

<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i>
    <a href="{:url('admin/index/index')}"> 首页</a>
    <span class="c-gray en">&gt;</span>
    <a href="{:url('admin/data_content/index')}">数据内容管理</a>
    <span class="c-gray en">&gt;</span>
    <a href="javascprit:;">{$tablename} - {$data.id ? '修改' : '新增'}</a>
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);"
        title="刷新">
        <i class="Hui-iconfont">&#xe68f;</i>
    </a>
</nav>

<div class="Hui-article">
	<article class="cl pd-20">
		<form action="{:url('doAddOrEdit',['id'=>$data.id,'tablename'=>$tablename])}" method="post" class="form form-horizontal" id="form-admin-category">
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">
                    <span class="c-red">*</span>标题：</label>
                <div class="formControls col-xs-4 col-sm-4">
                    <input type="text" class="input-text" value="{$data.title}" placeholder="请填写标题" id="title" name="title">
                </div>
                <div class="col-3"> </div>
			</div>
			<div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">
                    点击量：</label>
                <div class="formControls col-xs-4 col-sm-4">
                    <input type="number" class="input-text" value="{$data.clicks}" id="clicks" name="clicks">
				</div>
            </div>
            {foreach $table_extra_columns as $value}
            {php}
                if ($value->column_name_en == 'remark') {
                    continue;
                }
            {/php}
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">
                    {$value.column_name_cn}：</label>
                <div class="formControls col-xs-4 col-sm-4">
                    <input type="text" class="input-text" value="{$data[$value.column_name_en]}" placeholder="请填写{$value.column_name_cn}" id="{$value.column_name_en}" name="{$value.column_name_en}">
                </div>
                <div class="col-xs-4 col-sm-4 text-l">
                    {$value.note}</div>
                <div class="col-3"> </div>
            </div>
            {/foreach}
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">备注：</label>
                <div class="formControls col-xs-4 col-sm-4">
                    <textarea name="remark" id="remark" cols="" rows="" class="textarea" placeholder="说点什么...最多输入100个字符" datatype="*10-100" dragonfly="true"
                         onKeyUp="textarealength(this,200)">{$data.remark}</textarea>
                    <p class="textarea-numberbar">
                        <em class="textarea-length">0</em>/200</p>
                </div>
                <div class="col-3"> </div>
			</div>
			<div class="row cl">
				<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
					<button type="submit" class="btn btn-success radius" id="admin-powers-save" name="">确&nbsp;定</button>
					<button type="button" class="btn btn-default radius" onclick="window.history.back();" style="margin-left:20px;">取&nbsp;消</button>
				</div>
			</div>
		</form>
	</article>
</div>

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
	$("#form-admin-category").submit(function () {
		var note = $("#note").val();
		if (getblen(note) > 200) {
                layer.msg('备注过长', {
                    icon: 5,
                    time: 1000
                });
                return false;
            }
	})
</script>